home *** CD-ROM | disk | FTP | other *** search
/ Chip 2006 July / CHIP 2006-07.2.iso / program / web_gelistirme / easyphp1-7_setup.exe / {app} / phpmyadmin / server_variables.php < prev    next >
Encoding:
PHP Script  |  2003-09-07  |  2.6 KB  |  113 lines

  1. <?php
  2. /* $Id: server_variables.php,v 1.6 2003/03/18 13:33:23 nijel Exp $ */
  3. // vim: expandtab sw=4 ts=4 sts=4:
  4.  
  5.  
  6. /**
  7.  * Does the common work
  8.  */
  9. require('./server_common.inc.php');
  10.  
  11.  
  12. /**
  13.  * Displays the links
  14.  */
  15. require('./server_links.inc.php');
  16.  
  17.  
  18. /**
  19.  * Displays the sub-page heading
  20.  */
  21. echo '<h2>' . "\n"
  22.    . '    ' . $strServerVars . "\n"
  23.    . '</h2>' . "\n";
  24.  
  25.  
  26. /**
  27.  * Checks if the user is allowed to do what he tries to...
  28.  */
  29. if (!$is_superuser && !$cfg['ShowMysqlVars']) {
  30.     echo $strNoPrivileges;
  31.     include('./footer.inc.php');
  32.     exit;
  33. }
  34.  
  35.  
  36. /**
  37.  * Sends the queries and buffers the results
  38.  */
  39. if (PMA_MYSQL_INT_VERSION >= 40003) {
  40.     $res = @PMA_mysql_query('SHOW SESSION VARIABLES;', $userlink) or PMA_mysqlDie(PMA_mysql_error($userlink), 'SHOW SESSION VARIABLES;');
  41.     while ($row = PMA_mysql_fetch_row($res)) {
  42.         $serverVars[$row[0]] = $row[1];
  43.     }
  44.     @mysql_free_result($res);
  45.     $res = @PMA_mysql_query('SHOW GLOBAL VARIABLES;', $userlink) or PMA_mysqlDie(PMA_mysql_error($userlink), 'SHOW GLOBAL VARIABLES;');
  46.     while ($row = PMA_mysql_fetch_row($res)) {
  47.         $serverVarsGlobal[$row[0]] = $row[1];
  48.     }
  49.     @mysql_free_result($res);
  50. } else {
  51.     $res = @PMA_mysql_query('SHOW VARIABLES;', $userlink) or PMA_mysqlDie(PMA_mysql_error($userlink), 'SHOW VARIABLES;');
  52.     while ($row = PMA_mysql_fetch_row($res)) {
  53.         $serverVars[$row[0]] = $row[1];
  54.     }
  55.     @mysql_free_result($res);
  56. }
  57. unset($res);
  58. unset($row);
  59.  
  60.  
  61. /**
  62.  * Displays the page
  63.  */
  64. ?>
  65. <table border="0">
  66.     <tr>
  67.         <th> <?php echo $strVar; ?> </th>
  68. <?php
  69. echo '        <th> ';
  70. if (PMA_MYSQL_INT_VERSION >= 40003) {
  71.     echo $strSessionValue . ' </th>' . "\n"
  72.        . '        <th> ' . $strGlobalValue;
  73. } else {
  74.     echo $strValue;
  75. }
  76. echo ' </th>' . "\n";
  77. ?>
  78.     </tr>
  79. <?php
  80. $useBgcolorOne = TRUE;
  81. while (list($name, $value) = each($serverVars)) {
  82. ?>
  83.     <tr>
  84.         <td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>">
  85.             <?php echo htmlspecialchars(str_replace('_', ' ', $name)) . "\n"; ?>
  86.         </td>
  87.         <td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>">
  88.             <?php echo htmlspecialchars($value) . "\n"; ?>
  89.         </td>
  90. <?php
  91.     if (PMA_MYSQL_INT_VERSION >= 40003) {
  92. ?>
  93.         <td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>">
  94.             <?php echo htmlspecialchars($serverVarsGlobal[$name]) . "\n"; ?>
  95.         </td>
  96. <?php
  97.     }
  98.     $useBgcolorOne = !$useBgcolorOne;
  99. ?>
  100.     </tr>
  101. <?php
  102. }
  103. ?>
  104. </table>
  105. <?php
  106.  
  107.  
  108. /**
  109.  * Sends the footer
  110.  */
  111. require('./footer.inc.php');
  112.  
  113. ?>